#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>

int main(int argc, char* argv[])
{
    if(argc != 2) {
        printf("fifoname error\n");
        exit(1);
    }
    
    int fd = open(argv[1], O_WRONLY);

    char buf[256];
    int num = 1;
    while(1) {
        memset(buf, 0x00, sizeof(buf)); 
        sprintf(buf, "Kitty: %04d", num++);
        write(fd, buf, strlen(buf));
        sleep(1);
    }
    
    close(fd);

    return 0;
}

